var express = require('express');
var router = express.Router();
var profileService = require('../../services/profile');

router.get('/:id', async (req, res, next) => {
    const id = req.params.id;
    let data = profileService.findOne(id);
    res.json(data);
});

router.post('/', async (req, res, next) => {
    const reqData = req.body;
    console.log(reqData)
    let result = profileService.create(reqData);
    res.json(result);
});

module.exports = router;
